package io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        FileOutputStream fos = new FileOutputStream("./test3.txt",true);

        String str = sc.next();
        while (!"exit".equals(str)){
            byte[] data = str.getBytes(StandardCharsets.UTF_8);
            fos.write(data);
            str = sc.next();
        }
        System.out.println("已退出");
        fos.close();
    }
}
